package com.ys.service.amazonorder.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ys.mapper.amazonorder.AmazonorderMapper;
import com.ys.service.amazonorder.TcoYearCountryService;

@Service("tcoYearCountryService")
public class TcoYearCountryServiceImpl implements TcoYearCountryService {
    private static final Logger logger = LoggerFactory.getLogger(TcoYearCountryServiceImpl.class);

    @Autowired
    private AmazonorderMapper diySqlMapper;
    @Override
    public void addBatch(String year) {
        if (year == null || year.length() != 4) {
            return;
        }

        // 删除每日数据
        diySqlMapper.deleteBatchTcoYearCountry(year);

        // 添加每日数据
        int i = diySqlMapper.insertBatchTcoYearCountry(year);
        logger.info("时间---" + year + "，添加数量---" + i);
    }
}
